package com.android.lovely.ui.widget

import android.content.Context
import android.util.AttributeSet
import android.widget.FrameLayout
import androidx.core.view.isVisible
import com.android.lovely.databinding.LayoutCardGuideBinding
import com.android.lovely.databinding.LayoutSplashLoginBinding
import com.kotlin.extensions.inflater.LayoutInflaterExt.layoutInflater
import com.kotlin.extensions.view.ViewExt.clickable
import com.liupei.shape.widget.ShapeTextView

/**
 *
 * @author why
 * @date 2025/3/24 22:10
 */
class CardGuideWidget(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs) {

    private val mBinding by lazy {
        LayoutCardGuideBinding.inflate(layoutInflater, this, false)
    }

    init {
        addView(mBinding.root)
        updateGuide(0)
        mBinding.button.clickable {
            updateGuide(1)
        }
        mBinding.button2.clickable {
           isVisible = false
        }
    }

    private fun updateGuide(i: Int) {
        mBinding.clGuide1.isVisible = if(i == 0) true else false
        mBinding.clGuide2.isVisible = if(i == 1) true else false
    }
}